﻿<Controls:PhoneApplicationPage x:Class="TexasHoldemCalculator.View.HoleOddsView" 
                               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                               xmlns:Controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                               xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                               xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"
                               x:Name="HoleOddsViewPage"
                               ApplicationBar="{StaticResource GlobalApplicationBar}"
                               d:DesignHeight="800" d:DesignWidth="480"
                               DataContext="{Binding Source={StaticResource Locator}, Path=Odds}"
                               Style="{StaticResource DefaultPageTransition}"
                               SupportedOrientations="Portrait" mc:Ignorable="d">
    <Controls:PhoneApplicationPage.Resources>
        <DataTemplate x:Name="THCOddsExpanderDataTemplateNormal">
            <TextBlock Text=""/>
        </DataTemplate>
        <DataTemplate x:Name="THCOddsHeaderTemplate">
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding DisplayIcon}" />
                <TextBlock Style="{StaticResource THCStatsLargeHeaderText}" FontSize="30" Text="{Binding Description}" />
            </StackPanel>
        </DataTemplate>
        <!--DataTemplate x:Name="THCOddsHeaderItemTemplate">
            <TextBlock Text="{Binding Description}" />
        </DataTemplate-->
        <DataTemplate x:Name="THCOddsItemTemplate">
            <toolkit:ExpanderView Header="{Binding}" 
                                  Expander="{Binding}"
                                  ItemsSource="{Binding}"
                                  IsExpanded="{Binding IsExpanded, Mode=TwoWay}"
                                  HeaderTemplate="{StaticResource THCOddsHeaderTemplate}"
                                  ExpanderTemplate="{StaticResource THCOddsExpanderDataTemplateNormal}" Width="480">
                <toolkit:ExpanderView.Items>
                    <StackPanel Orientation="Vertical">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource THCOptionsLargeHeaderStyle}" Text="Percent:" Margin="0,0,10,0" />
                            <TextBlock Style="{StaticResource THCLargeValueStyle}" 
                                       Text="{Binding Path=Details.Percent}" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource THCOptionsLargeHeaderStyle}" Text="Odds:   " Margin="0,0,10,0" />
                            <TextBlock Style="{StaticResource THCLargeValueStyle}"
                                       Text="{Binding Path=Details.Odds}" />
                        </StackPanel>
                    </StackPanel>
                </toolkit:ExpanderView.Items>
            </toolkit:ExpanderView>
        </DataTemplate>
        <!--<ItemsPanelTemplate x:Name="THCOddsItemPanelTempate">
            <StackPanel />
        </ItemsPanelTemplate>-->
    </Controls:PhoneApplicationPage.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="65" />
            <RowDefinition Height="*" />
            <RowDefinition Height="85" />
        </Grid.RowDefinitions>

        <TextBlock Name="PokerPairOddsLabel"
                   Style="{StaticResource THCHandOddsHeaderStyle}"
                   Text="Hole Card Odds" />

        <ListBox Grid.Row="1"
                 ItemsSource="{Binding HoleOdds}"
                 ItemTemplate="{StaticResource THCOddsItemTemplate}"/>
        
        <my:AdControl x:Name="THCHoleOddsAd"
                      Grid.Row="2"
                      Width="{Binding Width}"
                      Height="{Binding Height}"
                      VerticalAlignment="Center"
                      DataContext="{Binding Source={StaticResource Locator}, Path=AdProvider}" />
    </Grid>
</Controls:PhoneApplicationPage>